package van.planifolia.factory.methodfactory;

/**
 * Created by Intellij IDEA<br>
 *
 * @author Planifolia.Van
 * @version 1.0
 * @date 2022/11/8 17:36
 */
public interface Factory {
    /**
     * 获取笔记本对象的接口
     * @return 创建出来的笔记本对象
     */
    NoteBook getBean();
}

/**
 * Dell笔记本的工厂要实现工厂接口
 */
class DellFactory implements Factory{
    @Override
    public NoteBook getBean() {
        return new DellNoteBook();
    }
}
/**
 * Mi笔记本的工厂要实现工厂接口
 */
class MiFactory implements Factory{
    @Override
    public NoteBook getBean() {
        return new MiNoteBook();
    }
}
